#include <stdio.h>
#include <string.h>
int main()
{
	FILE* fp = fopen("test.txt", "r");
	if (!fp) {
		printf("fopen error!\n");
	}
	char buf[1024];
	const char* str = "hello bit!\n";

	while (1) {
		ssize_t s = fread(buf, 1, strlen(str), fp);
		if (s > 0) {
			buf[s] = 0;
			printf("%s", buf);
		}
		if (feof(fp)) {
			break;
		}
	}
	fclose(fp);
	return 0;
}

